<?php


$demo_list = [
    'starter' => [
        'name' => '加载地图',
        'desc' => '快速入门并体验',

    ],
    'marker' => [
        'name' => '标记',
        'desc' => '自定义标记、添加、移除',
        'intro' => '点击地图可以添加点，点击标记可以移除。（除了初始化的那个）'
    ],
    'locate' => [
        'name' => '系统定位',
        'desc' => '尝试使用 Geolocation API 定位用户',
    ],
    'selectLocation' => [
        'name' => '选择位置',
        'desc' => '搜索选择经纬度和地址信息',
    ],
    'vectorLayer' => [
        'name' => '矢量图层',
        'desc' => '路径、区域、svg',
    ],
];

$current_demo = $demo_list[$current_page] ?? null;


?>

<div class="ul-nav-tree ul-padding-md site-left" style="width: 240px;">
    <div class="ul-nav-tree-group">
        <div class="ul-nav-tree-group-title">
            说明 </div>
        <div class="ul-nav-tree-group-main">
            <a href="/" class="ul-nav-tree-item">
                <div class="ul-nav-tree-item-title">首页</div>
                <div class="ul-nav-tree-item-desc">系统说明</div>
            </a>
        </div>
    </div>
    <div class="ul-nav-tree-group">
        <div class="ul-nav-tree-group-title">演示</div>
        <div class="ul-nav-tree-group-main">
            <?php foreach ($demo_list as $key => $demo) :?>
            <a href="<?php echo demo_url($key)?>"
               class="ul-nav-tree-item <?php echo $current_page == $key ? 'current' : '' ?>"
               title="<?php echo $demo['desc'] ?>">
                <div class="ul-nav-tree-item-title"><?php echo $demo['name'] ?></div>
                <div class="ul-nav-tree-item-desc"><?php echo $demo['desc'] ?></div>
            </a>
            <?php endforeach;?>
        </div>
    </div>
    <div class="ul-nav-tree-group">
        <div class="ul-nav-tree-group-title">
            文档 </div>
        <div class="ul-nav-tree-group-main">
            <a href="https://doc.ulthon.com/read/augushong/ul-free-free-map" class="ul-nav-tree-item">
                <div class="ul-nav-tree-item-title">文档中心</div>
                <div class="ul-nav-tree-item-desc">在线文档、代码、演示</div>
            </a>
            <a href="https://www.tianditu.gov.cn/" class="ul-nav-tree-item">
                <div class="ul-nav-tree-item-title">天地图官网</div>
                <div class="ul-nav-tree-item-desc">注册、实名</div>
            </a>
            <a href="https://leafletjs.cn/" class="ul-nav-tree-item">
                <div class="ul-nav-tree-item-title">Leaflet</div>
                <div class="ul-nav-tree-item-desc">引擎官网</div>
            </a>

        </div>
    </div>
</div>